import { request, config } from 'utils'

const { api } = config
const { roleList, roleListAll, roleAdd, roleEdit, roleQuery, roleDel, roleMultiDel, roleSet, permissionsQuery } = api

export async function list (params) {
  return request({
    url: roleList,
    method: 'post',
    data: params,
  })
}

export async function listall (params) {
  return request({
    url: roleListAll,
    method: 'post',
    data: params,
  })
}

export async function query (params) {
  return request({
    url: roleQuery,
    method: 'put',
    data: params,
  })
}


export async function create (params) {
  return request({
    url: roleAdd,
    method: 'post',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: roleEdit,
    method: 'put',
    data: params,
  })
}
export async function remove (params) {
  return request({
    url: roleDel,
    method: 'delete',
    data: params,
  })
}

export async function patchremove (params) {
  return request({
    url: roleMultiDel,
    method: 'delete',
    data: params,
  })
}
export async function set (params) {
  return request({
    url: roleSet,
    method: 'put',
    data: params,
  })
}
export async function getPermission (params) {
  return request({
    url: permissionsQuery,
    method: 'get',
    data: params,
  })
}


